package com.netease.financial.base.share.action;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;

import com.netease.financial.R;
import com.netease.financial.base.share.model.ShareHolder;
import com.netease.financial.common.util.ToastUtils;

/**
 * Created by wyf on 6/24/15.
 */
public class CopyLinkAction extends BaseShareAction {

    @Override
    public int getIconResId() {
        return R.drawable.ic_share_action_copy_link;
    }

    @Override
    public int getLabelResId() {
        return R.string.share_action_copy_link;
    }

    @Override
    public boolean share(Context context, ShareHolder holder) {
        super.share(context, holder);
        ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        clipboardManager.setPrimaryClip(ClipData.newPlainText(null, holder.webUrl));
        ToastUtils.showShort(context, R.string.copied_success);
        return true;
    }

}
